<template>
<view>
<!--<import src="../../../utils/wxParse/wxParse.wxml"></import>-->

<view class="wxParse">
    <jyf-parser :html="article_content"></jyf-parser>
</view>
</view>
</template>

<script>
var app = getApp();
var setting = app.globalData.setting;
var request = app.globalData.request;
var common = require("../../../utils/common.js");


export default {
  data() {
    return {
      url: setting.url,
      resourceUrl: setting.resourceUrl,
      content: '',
      title: '',
      article_content: ""
    };
  },

  components: {},
  props: {},

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.requestArticle(options.id);
  },
  methods: {
    requestArticle: function (id) {
      var that = this;
      request.get('/api/article/info', {
        data: {
          article_id: id
        },
        failRollback: true,
        success: function (res) {
          //WxParse.wxParse('content', 'html', res.data.result.content, that, 6)
          setTimeout(() => {
            that.article_content = res.data.result.content;
          }, 200);
          common.wxParseAddFullImageUrl(that, 'content');
          uni.setNavigationBarTitle({
            title: res.data.result.title
          });
        }
      });
    }
  }
};
</script>
<style>
 
</style>